package com.kyivmohyla.kma2.client.view.manager;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.logical.shared.HasValueChangeHandlers;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.datepicker.client.DatePicker;
import com.google.inject.Inject;
import com.kyivmohyla.kma2.client.presenter.manager.ManagerMainViewPresenter;
import com.kyivmohyla.kma2.client.view.common.OrderCellTableWidget;

public class ManagerMainView extends Composite implements ManagerMainViewPresenter.Display {
    private static ManagerMainViewUiBinder ourUiBinder = GWT.create(ManagerMainViewUiBinder.class);
    @UiField
    protected Button equipment;
    @UiField
    protected Button service;
    @UiField
    protected Button validate;
    @UiField
    protected Button closedOrders;
    @UiField
    protected Button access;
    @UiField
    protected Button editSelectedOrder;
    @UiField
    protected DatePicker dateBox;
    @UiField
    protected OrderCellTableWidget orderCellTable;

    @Inject
    public ManagerMainView() {
        initWidget(ourUiBinder.createAndBindUi(this));
    }

    @Override
    public HasClickHandlers getEquipmentButton() {
        return equipment;
    }

    @Override
    public HasClickHandlers getServiceButton() {
        return service;
    }

    @Override
    public HasClickHandlers getValidateButton() {
        return validate;
    }

    @Override
    public HasClickHandlers getAccessButton() {
        return access;
    }

    @Override
    public HasClickHandlers getClosedOrdersButton() {
        return closedOrders;
    }

    @Override
    public HasClickHandlers getEditSelectedOrderButton() {
        return editSelectedOrder;
    }

    @Override
    public HasValueChangeHandlers getDateBox() {
        return dateBox;
    }

    @Override
    public OrderCellTableWidget getOrderCellTable() {
        return orderCellTable;
    }

    public Widget asWidget() {
        return this;
    }

    interface ManagerMainViewUiBinder extends UiBinder<Widget, ManagerMainView> {
    }
}